<template>
	<view>
		<view>
			<image src="../../static/logo-1.png" class="login" mode="widthFix"></image>
			<view class="login-title">
				云上企业数字化智慧系统
			</view>
			<view class="login-subtitle">
				Version 1.0.0 2024
			</view>
			<button class="login-btn" open-type="getUserInfo" @tap="toRegister()">进入系统</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
	
			}
		},
		methods: {
			toRegister: function() {
				let that = this;
				that.ajax(that.url.tokentimeout, 'POST', null, function(resp) {
					console.log("toRegister")
					let data = resp.data;
					console.log(data)
					if(data.ttl<=0){
						uni.removeStorageSync("token")
					}
				});
				let token = uni.getStorageSync("token")
				console.log(token)
				if(token){
					uni.switchTab({
						url: '../index/index'
					})
				}else{
					uni.navigateTo({
						url: "../login/login"
					})
				}
				
			}
		}
	}
</script>

<style lang="less">
	@import url("./start.less");
</style>
